package com.tangly.module.vo;

import com.tangly.module.entity.UserInfoEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.BeanUtils;

@Data
@ApiModel(description = "用户信息返回包")
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class AppUserInfoVO {

    @ApiModelProperty(value = "用户名")
   private String nickname;

    @ApiModelProperty(value = "头像地址")
    private String avatar;


    /**
     * 实体转vo
     * @param entity
     * @return
     */
    public static AppUserInfoVO convert(UserInfoEntity entity) {
        AppUserInfoVO vo = new AppUserInfoVO();
        BeanUtils.copyProperties(entity,vo);
        return vo;
    }
}
